package demo;

public class Teacher {
    private String name;
    private int age;

    public Teacher() {
    }

    public Teacher(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public Teacher setName(String name){
        this.name = name;
        return this;
    }

    public String getName() {
        return name;
    }

    public static void main(String[] args) {
        Teacher t1 = new Teacher();
        t1.setName("余生").setAge(18);
//        t1.getAge().getName();
        System.out.println(t1.getName() + t1.getAge());
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }


}
